{% extends "base.html" %}

{% block title %}
    个人考勤管理
{% endblock %}

{% block label %}
    <div class="col-lg-12">
        <h1 class="page-header">个人考勤管理</h1>
    </div>
{% endblock %}

{% block content %}
    <div class="col-lg-12">
        <ul class="nav nav-pills">
            <li class="active"><a href="#kqjl" data-toggle="tab">考勤记录</a></li class="active">
            <li><a href="#kqsq" data-toggle="tab">考勤申请</a></li>
        </ul>
        <div class="tab-content">
            <div id="kqjl" class="tab-pane fade in active">
                <table class="table">
                    <thead>
                    <tr>
                        <th>假条编号</th>
                        <th>假条状态</th>
                        <th>请假类型</th>
                        <th>请假原因</th>
                        <th>起始时间</th>
                        <th>时长</th>
                        <th>审核人</th>
                        <th>销假</th>

                    </tr>
                    </thead>
                    <tbody>
                    {% for a in attendance_list %}
                    <tr>
                        <td class="col-lg-1">{{ a.id}}</td>
                        <td class="col-lg-1">
                            {% if a.a_state == 0 %}
                                申请中
                            {% elif a.a_state == 1 %}
                                通过
                            {% elif a.a_state == 2 %}
                                驳回
                            {% elif a.a_state == 3 %}
                                销假
                            {% endif %}
                        </td>
                        <td class="col-lg-1">{{ a.a_type }}</td>
                        <td class="col-lg-3">{{ a.a_reason }}</td>
                        <td class="col-lg-2">{{ a.a_time }}</td>
                        <td class="col-lg-2">{{ a.a_long }}</td>
                        <td class="col-lg-2">{{ a.verify_person|v_name }}</td>
                        <td class="col-lg-2">
                            {% if a.a_state == 1 %}
                            <a class="btn btn-success" href="/verify/{{ a.id }}/?change=3">销假</a>
                            {% else %}
                            <a class="btn btn-success" href="#" disabled="">销假</a>
                            {% endif %}
                        </td>

                    </tr>
                    {% endfor %}


                    </tbody>
                </table>
            </div>
            <div id="kqsq" class="tab-pane fade in">
                <form method="post">
                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                    <div class="form-group">
                        <label>原因:</label>
                        <textarea class="form-control" name="reason"></textarea>
                    </div>
                    <div class="form-group">
                        <label>类型:</label>
                        <select class="form-control" name="a_type">
                            <option value="事假">事假</option>
                            <option value="婚嫁">婚嫁</option>
                            <option value="产假">产假</option>
                            <option value="病假">病假</option>
                            <option value="年假">年假</option>
                            <option value="调休">调休</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label>假期时长(天):</label>
                        <input class="form-control" type="text" name="a_time">
                    </div>
                    <div class="form-group">
                        <label>开始时间:</label>
                        <input class="form-control" type="text" name="start">
                    </div>
                    <div class="form-group">
                        <label>审核人:</label>
                        <select class="form-control" name="verify_person">
                            {% for l in leader_list %}
                            <option value="{{ l.id }}">{{ l.name }}</option>
                            {% endfor %}
                        </select>
                    </div>

                    <div class="form-group">
                        <button class="btn btn-primary btn-block">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endblock %}



